<?php
namespace App\Http\Controllers\Api\v1;
use App\Models\City;
use App\server\RedisServer;
class CityController
{
    public function index()
    {
        $data=City::getAll();
        foreach ($data as $v)
        {
            foreach ($v as $value)
            {
                $redis=RedisServer::createRedisObject();
                $redis->select(6);
                $redis->persist('city'.$v['id']);
                $redis->Data_lpush('city'.$v['id'],$value);
            }
        }
    }
}
